<!--
    审批历史展示 公共插件
    传入参数：
        对象参数
            Obj：{
                caseNo：案件编号，
                contractNo:合同号码
            }
 -->
<template>
    <div style="width: 100%;">
        <Table :columns="columns" :data="formData"></Table>
    </div>
</template>
<script>
    import {
        getBasicInfo,
    } from "_p/basic/api/contract/common/approve-history/approve-history";
    import {channelType} from "_p/basic/api/contract/channel-type/channel-type";

    export default {
        props: {
            //对象参数包含：合同号码、案件编号
            Obj: {
                type: Object,
                required: true,
            }
        },
        data() {
            return {
                formData: [],

                columns: [
                    {
                        title: "流程节点",
                        key: "nodeName",
                    },
                    {
                        title: "部门",
                        key: "department",
                    },
                    {
                        title: "处理人",
                        key: "processPerson",
                    },
                    {
                        title: "处理命令",
                        key: "approvalOpinion",
                    },
                    {
                        title: "处理时间",
                        key: "createTime",
                    },
                    {
                        title: "原因类型",
                        key: "reasonType",
                    },
                    {
                        title: "审批意见",
                        key: "remarks",
                    },
                ],
            }
        },
        mounted() {
            this.init();
        },
        methods: {
            init() {
                this.getBasicInfo();
            },
            getBasicInfo() {
                getBasicInfo(this.Obj.contractNo, this.Obj.caseNo, channelType(this.$route.meta.params)).then(res => {
                    if (res.code === "0000") {
                        this.formData = res.data;
                    }
                });
            },

        }
    }
</script>
